package com.hmall.common.api;
import com.hmall.common.dto.PageDTO;
import com.hmall.common.pojo.Item;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
@FeignClient("itemservice")
public interface ItemFeignClient {
    @RequestMapping("/item/list")
    PageDTO<Item> page(@RequestParam("page") Integer page, @RequestParam("size") Integer size);

    @RequestMapping("/item/{id}")
    Item getById(@PathVariable("id") Long id);

    @PutMapping("/item/stock/{itemId}/{num}")
    boolean update(@PathVariable("itemId") Long itemId,@PathVariable("num") int num);



    @PutMapping("/item/stock/recover/{itemId}/{num}")
    void recoverStock(@PathVariable("itemId") Long itemId, @PathVariable("num") Integer num);
}
